package foard.model
{
	public class EntryModel
	{
		public function EntryModel(data:String)
		{
			setData(data);
		}
		
		//--
		
		private var _data:String;
		public function get data():String
		{
			return _data;
		}
		
		private var _body:String;
		public function get body():String
		{
			return _body;
		}

		private var _header:String;
		public function get header():String
		{
			return _header;
		}
		
		//--
		
		protected function setData(data:String):void
		{
			var arr:Array = data.split("<>");
			_data = data;
			_body = arr[3];
			_header = arr[2];
			
			trace(data);
			
			if(_body)
			{
				_body = _body.replace(/<br>/ig, "\n");
				_body = _body.replace(/<\/a>/ig, " ");
				_body = _body.replace(/<a.*?>/ig, " ");
				_body = _body.replace(/&lt;/ig, "<");
				_body = _body.replace(/&gt;/ig, ">");
				_body = unescape(_body);
			}
			else
			{
				trace("error");
			}
		}
		
		//--
		
		public function toString():String
		{
			return header+"\n"+body;
		}
	}
}









